<template>
  <div class="container">
    <search-bar></search-bar>
    <home-showcase></home-showcase>
  </div>
</template>

<script>
import { postDocumentRecommend } from "@/api/home/home";
import SearchBar from "@/components/Frame/SearchBar/SearchBar.vue";
import HomeShowcase from "@/components/Home/HomeShowcase/HomeShowcase.vue";

export default {
  components: { SearchBar, HomeShowcase },
  data() {
    return {
      recommendData: [],
      recommendImages: [],
      total: 0,
    };
  },
  methods: {
    getDocumentRecommend(page) {
      let data = {
        from: (page - 1) * 12,
        size: 12,
      };
      let body = JSON.stringify(data);
      postDocumentRecommend(body).then((res) => {
        this.recommendData = res.result.myFiles;
        // console.log(res);
        this.recommendImages = res.result.previewList;
        this.total = res.result.total;
      });
    },
  },
};
</script>

<style scoped>
.container {
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 800px;
  width: 100%;
  background-image: url("@/assets/image/common/background/background.png");
  background-size: 100% 800px;
  background-repeat: no-repeat;
}
</style>
